<template>
	<view>
		<ttBar title=" " bgColor="rgba(0,0,0,0)" color="#ffffff" :showZhanwei="false">
			<template v-slot:leftCnt>
				<text class="iconfont icon-back lIcon" :style="{'background-color':'rgba(0,0,0,0.5)'}"></text>
			</template>
		</ttBar>
		<view class="content">
			<image class="banner" src="http://m.qpic.cn/psc?/V10bU8y22MQDQX/TmEUgtj9EK6.7V8ajmQrEM7YfyNUHWaP33adWWh8ufS44fdxGMcFt8.aqWsU0uuPkApadKGgiwH0xxd6qI14pYKuEMjO1D350NuiPa61c*o!/b&bo=7gI2AQAAAAADF.k!&rf=viewer_4" ></image>
		</view>
		<scroll-view scroll-y="true" :style="{'height':scHeight+'px'}">
			<view class="zeroList">
				<zeroItem v-for="(item,index) in rmdList" :item="item" :key="index"></zeroItem>
				<empty-box v-if="rmdList.length<1" :isLoding="loding"></empty-box>
			</view>
		</scroll-view>
		
	</view>
</template>

<script>
	import {
		mapState,
		mapGetters,
		mapMutation,
		mapActions
	} from "vuex";
	import zeroItem from "@/pagesA/components/zeroBuy/zeroItem.vue";
	export default {
		computed: {
			...mapState({
				locationCity:state=>state.map.locationCity,
				roads:state=>state.map.roads,
				selectCity:state=>state.map.selectCity,
				initInfo:state=>state.sys.initInfo
			})
		
		},
		components:{zeroItem},
		data() {
			return {
				scHeight:uni.getSystemInfoSync().screenHeight-uni.upx2px(310),
				hasNext:true,
				rmdList:[],
				rmdFilter:{
					page_no:1,
					page_size:10,
					areaId:3201,
				},
				loding:true
			};
		},
		methods:{
			getData(){
				if(this.hasNext){
					this.loding=true;
					this.$store.dispatch("apiGetZeroList",this.rmdFilter).then(res=>{
						this.rmdList=this.rmdList.concat(res.data.data.items);
						this.loding=false
					})
				}
			}
		},
		onLoad() {
			this.getData();
		},
		onPullDownRefresh() {
			this.rmdFilter={
				page_no:1,
				page_size:10,
				areaId:this.selectCity.cityCode,
			}
			this.hasNext=true;
			this.loding=true;
			this.rmdList=[];
			setTimeout(() => {
				this.getData()
				uni.stopPullDownRefresh();
			}, 1500)
		}
	}
</script>

<style lang="less">
	page{
		background-color: #F7F7F7;
	}
	.zeroList{
		padding: 16upx;
	}
	.banner{
		width: 100%;
		height: 310upx;
		display: block;
	}
	.content{
		padding: 0;
	}
	.lIcon{
		font-size: 44upx;
		font-weight: normal;
		width: 70upx;
		height: 70upx;
		background-color: rgba(0,0,0,0.5);
		text-align: center;
		line-height: 70upx;
		border-radius: 50%;
	}
</style>
